package com.example.springboot.controller;


import com.example.springboot.pojo.Result;
import com.example.springboot.pojo.Admin;
import com.example.springboot.service.AdminService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@Slf4j
@RestController
public class AdminController {
    @Autowired
    private AdminService AdminService;

    @PostMapping ("/dashboards")
    public Result list() {
        log.info("查询表的所有数据");
        List<Admin> AdminList = AdminService.list();
        return Result.success(AdminList);

    }
}